package com.hongyuan.sellfitness.ui.find.view_mode;

import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.databinding.ObservableField;

import com.hongyuan.mvvmhabitx.binding.command.BindingAction;
import com.hongyuan.mvvmhabitx.binding.command.BindingCommand;
import com.hongyuan.sellfitness.base.CustomViewModel;
import com.hongyuan.sellfitness.base.ItemViewModel;
import com.hongyuan.sellfitness.ui.find.activity.CircleDetailActivity;
import com.hongyuan.sellfitness.ui.find.beans.CircleBeans;
import com.hongyuan.sellfitness.ui.person.activity.UserInfoActivity;

public class CircleItemViewModel extends ItemViewModel<CustomViewModel> {

    public ObservableField<CircleBeans.ListBean> entity = new ObservableField<>();

    public CircleItemViewModel(@NonNull CustomViewModel viewModel, CircleBeans.ListBean bean) {
        super(viewModel);
        entity.set(bean);
    }

    //条目的点击事件
    public BindingCommand itemClick = new BindingCommand(new BindingAction() {
        @Override
        public void call() {
            Bundle bundle = new Bundle();
            bundle.putString("circle_categoryid",String.valueOf(entity.get().getCategory_id()));
            viewModel.startActivity(CircleDetailActivity.class,bundle);
        }
    });
}
